<?php
/**
 * Created by PhpStorm.
 * User: david
 * Date: 2018/6/11
 * Time: 15:21
 */

namespace app\controller;

use app\model\Job as JobModel;
use think\Request;

class Join extends Base
{
    protected $currentPage = 1;

    protected $nextPage = 2;

    protected $hasMore = true;

    public function policy()
    {
        return view('policy');
    }

    public function zhaopin(Request $request)
    {
        $jobs = JobModel::getJobs($request->param());
        return view('zhaopin', compact(['jobs']));
    }

    public function detail($id)
    {
        $job = JobModel::get($id);
        $job->requirements = explode("\n", $job->requirements);
        $job->responsibility = explode("\n", $job->responsibility);
        return view('detail', compact(['job']));
    }
}